test(selfhost): cover env_get and require_cmd in selfhost-deploy-common - #7945
Conversation
Adds unit coverage for the two remaining untested functions in scripts/lib/selfhost-deploy-common.sh, following the existing maybe_infisical_run / env_put / compose_file_args harness in the same file: - require_cmd: present (silent no-op) and missing (exit 1 + stderr message). - env_get: plain value, single/double-quote stripping, whitespace trim + indented key, comment-line skipping + first-match, absent key -> 1, absent file -> 1, and the $ENV_FILE fallback when no file arg is given. Also documents both functions' contracts inline (the file already documents env_put / maybe_infisical_run / compose_file_args this way). env_put (JSONbored#7766) and compose_file_args (JSONbored#7765) already have coverage from their bug-fix PRs, so they are left as-is per the issue's "don't duplicate" note. Closes JSONbored#7769
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7945 +/- ##
===========================================
+ Coverage 78.19% 91.79% +13.60%
===========================================
Files 733 733
Lines 75143 75143
Branches 22917 22917
===========================================
+ Hits 58761 68981 +10220
+ Misses 13419 5083 -8336
+ Partials 2963 1079 -1884
Flags with carried forward coverage won't be shown. Click here to find out more. |
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-21 20:33:01 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Summary
Closes #7769 — adds unit coverage for the two remaining untested functions in
scripts/lib/selfhost-deploy-common.sh(env_getandrequire_cmd), matching the existingmaybe_infisical_run/env_put/compose_file_argsharness already intest/unit/selfhost-deploy-common.test.ts.env_put(#7766) andcompose_file_args(#7765) already got their coverage from those bug-fix PRs, so per the issue's "check before duplicating" note they're left untouched — this fills in only the genuinely-uncovered two.What's covered
require_cmderror: required command not found: <cmd>on stderrenv_get$ENV_FILEwhen no file argument is givenNotes
require_cmdandenv_get, matching how the same file already documentsenv_put/maybe_infisical_run/compose_file_args.bash -nclean;selfhost:env-reference:checkunaffected.